﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ListenMusic.Models.Reposistory.User;
using ListenMusic.Models.Reposistory.Public;
using ListenMusic.Models;
namespace ListenMusic.Controllers.Public
{
    public class HomeController : ApplicationController
    {
        //
        // GET: /Home/
       
        public HomeController()
        {
         
        }
        public ActionResult Index()
        {
            ViewBag.banner = _album.get5New_Albun();
            ViewBag.topAlbum = _album.getBXH_Album();
            ViewBag.topVideo = _video.getBXH_Video();
            ViewBag.topSong = _song.getBXH_Song();
            ViewBag.allCategory = _category.getAllCategory();
            ViewBag.allCountry = _country.getAllCountry();
            ViewBag.allSinger = _singer.getAllSinger_byCountry();
            ViewBag.newAlbum = _album.get8Random_Album();
            ViewBag.newVideo = _video.get12Random_Video();
            ViewBag.newSong = _song.get20Random_Song();
            var files = _dowload.GetFiles();
            if (Session["user"] != null)
            {
             
                ViewBag.playList = _playlist.getPlaylist_ByMemberID(Session["user"].ToString());
                ViewBag.songInPlaylist = _playlist.getSongInPlaylist(Session["user"].ToString()); 
            }
            
            return View("HomePage",files);
        }

    }
}
